<?php 

class MemoServ extends AthemePHP {
	
	function MemoServ($xmlURL)
	{
		$this->xmlURL = $xmlURL;
		$this->include = false;
	}
	
	/**
	 * 
	 * @param $nick
	 * @param $athemeid
	 * @return error code or response
	 */
	function GetList($nick, $athemeid)
	{
		$this->addParam('MEMOSERV');
		$this->addParam('LIST');
		
		$result = $this->doCMD($nick, $athemeid);
		
		if($result['methodResponse']['fault']['value']['struct']['member'][0]['value']['int'])
		{
			$retRes = $result['methodResponse']['fault']['value']['struct']['member'][0]['value']['int'];
		} else {
			$retRes = $result['methodResponse']['params']['param']['value']['string'];
		}
		
		return $retRes;
	}
	
	/**
	 * 
	 * @param $nick
	 * @param $athemeid
	 * @param $memono
	 * @return error code or response
	 */
	function Read($nick, $athemeid, $memono)
	{
		$this->addParam('MEMOSERV');
		$this->addParam('READ');
		$this->addParam($memono);
		
        $result = $this->doCMD($nick, $athemeid);
		if($result['methodResponse']['fault']['value']['struct']['member'][0]['value']['int'])
		{
			$retRes = $result['methodResponse']['fault']['value']['struct']['member'][0]['value']['int'];
		} else {
			$retRes = $result['methodResponse']['params']['param']['value']['string'];
		}

		return $retRes;
	}
	
}

?>